﻿@page "/forbidden"
@namespace Project.Web.Shared.Components
@inherits AppComponentBase
<div class="error-page-wrapper">
    <div class="content-container">
        <div class="head-line">
            <MIcon IconName="@svgName" Style="height:100%;width:100%;"></MIcon>
        </div>
        <div class="subheader">
            HTTP 403 - 当前用户无法访问此页面！
        </div>
        @* <div class="hr"></div>
        <div class="context">
            <p>
                您可以返回首页，或联系管理员
            </p>
        </div>
        <div class="buttons-container">
            <a href="#" @onclick="e => NavigatorToIndex()">去首页</a>
        </div> *@
    </div>
</div>

@code {
    string svgName = "p403_01";
    protected override void OnInitialized()
    {
        base.OnInitialized();
        var i = Random.Shared.Next(0, 100);
        var index = i % 2 == 0 ? "01" : "02";
        svgName = $"p403_{index}";
    }

    void NavigatorToIndex()
    {
        Navigator.NavigateTo("/");
    }
}
